home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 3.iso / dist / fw_openssh.idb / tmp / check-ssh-config.z / check-ssh-config
Text File  |  2002-07-08  |  1KB  |  46 lines

  1. #!/bin/sh -fb
  2. # Time-stamp: "Sat 29 Jun 2002, 11:51:59 EDT by drk@sgi.com (David Kaelbling)"
  3. #
  4. # Test to see whether the sshd user exists, and complain if it doesn't.
  5. # Also warn about disabling a running sshd, in case that's the only
  6. # way of logging in to the system.
  7.  
  8. config=fw_sshd
  9. user=sshd
  10. daemon=sshd
  11.  
  12. # If we return bad status inst will complain about a failing exitop, 
  13. # and hopefully the installer will actually read our messages.
  14. status=0
  15.  
  16. if ! /sbin/grep -q "^${user}:" /etc/passwd; then
  17.     echo "";
  18.     echo "**** WARNING ****"
  19.     echo "There does not appear to be an '$user' user on this system."
  20.     echo "The fw_openssh daemon $daemon will _not_ be usable unless you"
  21.     echo "either create one or disable UsePrivilegeSeparation.  You"
  22.     echo "should fix this and 'chkconfig $config on' before restarting"
  23.     echo "See /usr/freeware/relnotes/openssh.html for more information."
  24.     echo "";
  25.     status=1
  26.  
  27. elif ! /sbin/chkconfig $config && \
  28.      (/sbin/ps -ef | /sbin/grep -v grep | /sbin/grep -q $daemon); then
  29.     echo "";
  30.     echo "**** WARNING ****"
  31.     echo "It looks like you are currently running $daemon.  fw_openssh $daemon"
  32.     echo "is disabled by default.  You may want to 'chkconfig $config on'"
  33.     echo "before restarting."
  34.     echo "";
  35.     status=1
  36. fi
  37.  
  38. # Try to delete ourself if we're running from /tmp.
  39. if [ -x "$0" ]; then 
  40.     case "$0" in
  41.         /tmp/*) rm "$0";;
  42.     esac
  43. fi
  44.  
  45. exit $status
  46.